import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jump_scape/js_ui/js_widget/js_blur_group.dart';
import 'package:jump_scape/js_ui/js_widget/js_image_view.dart';
import 'package:jump_scape/js_ui/js_widget/js_text_ghosting_view.dart';

class JsTitleView extends StatelessWidget {
  final String title;
  const JsTitleView({super.key, required this.title});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(top: ScreenUtil().statusBarHeight),
      child: Row(
        children: [
          // Back
          InkWell(
            onTap: () {
              if (Navigator.canPop(context)) {
                Navigator.pop(context);
              }
            },
            child: Container(
              padding: EdgeInsets.fromLTRB(18.r, 15.r, 18.r, 0),
              child: jsImage('assets/image/ic_finish.png', width: 64.r, height: 64.r),
            ),
          ),
          Spacer(),
          // Title
          JsBlurGroup(
            height: 43.r,
            radius: 15.r,
            margin: EdgeInsets.only(top: 30.r, right: 22.r),
            padding: EdgeInsets.symmetric(horizontal: 24.r),
            child: JsTextGhostingView(title, fontSize: 18.r),
          ),
        ],
      ),
    );
  }
}
